﻿#ifndef READERMANAGER_H_
#define READERMANAGER_H_

#include "Reader.h"
#include <QString>
#include <QList>
#include <QDebug>



class Reader;


class ReaderManager
{
public:
	using iterator = QList<Reader*>::iterator;
	inline iterator begin() { return m_readers.begin(); }
	inline iterator end() { return m_readers.end(); }

	void addReader(Reader* user);
	Reader* findReaderByNo(const QString& readerno);
	Reader* findReaderByName(const QString& readername);
	Reader* findReaderBydept(const QString& readerdept);
	Reader* findReaderBytel(const int& readertel);


	//单例模式：	满足	系统的要求	只能有一个类对象
	static ReaderManager* instance();


private:
	//单例模式	构造函数私有化：
	ReaderManager(){}
public:
	QList<Reader*> m_readers;

};

#endif // !READERMANAGER_H_
